package com.hxkcloud.nurse.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.hxkcloud.nurse.R;
import com.hxkcloud.nurse.beans.ArticleBean;
import com.hxkcloud.nurse.utils.ImageOptionUtils;
import com.hxkcloud.nurse.views.RoundImageView;

import java.util.List;

/**
 * 健康资讯
 * Created by Administrator on 2016/12/27.
 */

public class InformationAdapter extends MyModelBaseAdapter<ArticleBean> {
    public InformationAdapter(List<ArticleBean> list, Context context, int resourceId) {
        super(list, context, resourceId);
    }

    @Override
    public void initView(View convertView, int position) {
        RoundImageView information_icon = (RoundImageView) convertView.findViewById(R.id.information_icon);
        TextView information_time = (TextView) convertView.findViewById(R.id.information_time);
        TextView information_title = (TextView) convertView.findViewById(R.id.information_title);
        TextView information_dsc = (TextView) convertView.findViewById(R.id.information_dsc);
        ImageLoader.getInstance().displayImage(getItem(position).getImg(), information_icon, ImageOptionUtils.getInstance().getArticlePicBigOptions(2));
        information_time.setText(getItem(position).getCreateTime());
        information_title.setText(getItem(position).getName());
        information_dsc.setText(getItem(position).getIntro());
    }
}
